package com.bleeth.fx.view.demo2;

import com.bleeth.fx.helper.ControlsHelper;
import com.bleeth.fx.helper.StyleHelper;
import com.bleeth.fx.layout.FormBuilder;
import com.bleeth.fx.layout.GirdCell;
import com.bleeth.fx.meta.IForm;
import com.bleeth.fx.meta.View;
import javafx.beans.property.Property;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;

/**
 * @author Sakura
 * @version 1.0
 * @date 2021-11-13 22:17
 **/
@View(value = "top")
public class TopView implements IForm {

    private VBox topForm;
    private Label label_1;
    private Label label_2;


    @Override
    public Region make(Property... properties) {

        label_1 = ControlsHelper.createLabel("Angular Electron Admin", "", "");
        label_2 = ControlsHelper.createLabel("Theme", "", "");

        topForm = FormBuilder.form(null, 80D)
                .coverRow(GirdCell.createCell(30D, Pos.CENTER), GirdCell.createCell(250D, Pos.CENTER_LEFT), GirdCell.createCell(1, Pos.CENTER),
                        GirdCell.createCell(50D, Pos.CENTER_RIGHT), GirdCell.createCell(30D, Pos.CENTER)
                )
                .coverCell(1, label_1)
                .coverCell(3, label_2)
                .endRow(false)
                .build();
        topForm.setUserData("nnnn");
        css();
        return topForm;
    }

    @Override
    public void css() {
        StyleHelper.ft(label_1).fill("#ffffff").size(20).make();
        StyleHelper.ft(label_2).fill("#ffffff").size(14).make();
        StyleHelper.bg(topForm).color("#65c58e").make();
    }


}
